﻿
/*----------------------------------------------------------------//
// 文件名：MoWordsrvstatus.cs
// 文件功能描述：实体 MoWordsrvstatus.
// 
// 创建标识：2009-05-03
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoWordsrvstatus
using System;
using System.Data;
namespace DocSrv.Model
{
	/// <summary>
	/// 业务实体MoWordsrvstatus
	/// </summary>
	public partial class MoWordsrvstatus:ICloneable
	{
		#region 表Wordsrvstatus的字段
		private string pkId;
		private int rc;
		private DateTime updateTime;
		private string description;
		#endregion
		
		#region 构造函数
		public MoWordsrvstatus()
		{
			  updateTime=new DateTime(1900,1,1);   	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoWordsrvstatus(MoWordsrvstatus item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoWordsrvstatus(string pkId,int rc,DateTime updateTime,string description)
		{
		this.pkId=pkId;
		this.rc=rc;
		this.updateTime=updateTime;
		this.description=description;
		}
		#endregion
		
		#region 表Wordsrvstatus的字段属性
		/// <summary>
        /// 待处理对象的实体主键，通过它能够找到任务的来源。它实际是MoWordSrvT(ctid)或MoWordSrvR(reportid)的主键。
        /// 这个只是用来判定来源对象是否已经处理过了。
		/// </summary>
		public string PkId
		{
			get {return pkId;}
			set {pkId=value;}
		}
		/// <summary>
		/// 状态码
		/// </summary>
		public int Rc
		{
			get {return rc;}
			set {rc=value;}
		}
		/// <summary>
		/// UPDATE_TIME
		/// </summary>
		public DateTime UpdateTime
		{
			get {return updateTime;}
			set {updateTime=value;}
		}
		/// <summary>
		/// DESCRIPTION
		/// </summary>
		public string Description
		{
			get {return description;}
			set {description=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoWordsrvstatus CopyTo(MoWordsrvstatus item)
        {
		    item.pkId=this.pkId;
		    item.rc=this.rc;
		    item.updateTime=this.updateTime;
		    item.description=this.description;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoWordsrvstatus mo=new MoWordsrvstatus();
		    mo.PkId=this.PkId;
		    mo.Rc=this.Rc;
		    mo.UpdateTime=this.UpdateTime;
		    mo.Description=this.Description;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoWordsrvstatus NewWordsrvstatus = obj as MoWordsrvstatus;
                if (NewWordsrvstatus == null)
                {
                    return false;
                }
                else
                {
				if (NewWordsrvstatus.PkId==this.PkId && NewWordsrvstatus.Rc==this.Rc && NewWordsrvstatus.UpdateTime==this.UpdateTime && NewWordsrvstatus.Description==this.Description)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"TrId={0}/Rc={1}/UpdateTime={2}/Description={3}",pkId,rc,updateTime,description);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["TR_ID"]!=null && row["TR_ID"]!=DBNull.Value)
			{
			    this.PkId = (string)row["TR_ID"];
			}
			else
			{
				this.PkId =string.Empty;
			}
		    if(row["RC"]!=null && row["RC"]!=DBNull.Value)
			{
			    this.Rc = (int)row["RC"];
			}
			else
			{
				this.Rc =0;
			}
		    if(row["Update_Time"]!=null && row["Update_Time"]!=DBNull.Value)
			{
			    this.UpdateTime = (DateTime)row["Update_Time"];
			}
			else
			{
				this.UpdateTime =DateTime.MinValue;
			}
		    if(row["Description"]!=null && row["Description"]!=DBNull.Value)
			{
			    this.Description = (string)row["Description"];
			}
			else
			{
				this.Description =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["TR_ID"] = this.PkId;
			row["RC"] = this.Rc;
			row["Update_Time"] = this.UpdateTime;
			row["Description"] = this.Description;
		}
		#endregion
	}
}
#endregion
